/*
 * MP3_Beaney - The MP3 Tag Editor is a free ID3-Tag Editor
 * Copyright (C) 2012 Bernhard Teismann, André Seipelt, Steffen Gruschka, Imanuel Rohlfing
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package uInterface;

/**
 * Panel for database selection.
 *
 * @author Steffen Gruschka
 * @author Bernhard Teismann
 * @author André Seipelt
 * @author Imanuel Rohlfing
 * @version 1.0
 */
public class Step2 extends javax.swing.JPanel {

    /**
     * Creates new form Step2
     */
    public Step2(){
        initComponents();
        extendedInit();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Step2Panel = new javax.swing.JPanel();
        Step2RadioManual = new javax.swing.JRadioButton();
        Step2RadioDatabase = new javax.swing.JRadioButton();
        Step2TextArtist = new javax.swing.JTextField();
        Step2TextAlbum = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));
        setPreferredSize(new java.awt.Dimension(1095, 400));

        Step2Panel.setBackground(new java.awt.Color(255, 255, 255));
        Step2Panel.setPreferredSize(new java.awt.Dimension(987, 460));

        Step2RadioManual.setBackground(new java.awt.Color(255, 255, 255));
        Step2RadioManual.setSelected(true);
        Step2RadioManual.setLabel("Manuell");
        Step2RadioManual.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Step2RadioManualActionPerformed(evt);
            }
        });

        Step2RadioDatabase.setBackground(new java.awt.Color(255, 255, 255));
        Step2RadioDatabase.setLabel("Suchen via FreeDB");
        Step2RadioDatabase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Step2RadioDatabaseActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel2.setText("Wie sollen die Tags editiert werden?");
        jLabel2.setPreferredSize(new java.awt.Dimension(266, 16));

        jLabel3.setBackground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Künstler:");

        jLabel4.setBackground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Album:");

        org.jdesktop.layout.GroupLayout Step2PanelLayout = new org.jdesktop.layout.GroupLayout(Step2Panel);
        Step2Panel.setLayout(Step2PanelLayout);
        Step2PanelLayout.setHorizontalGroup(
            Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(Step2PanelLayout.createSequentialGroup()
                .add(127, 127, 127)
                .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(Step2PanelLayout.createSequentialGroup()
                        .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 322, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(337, Short.MAX_VALUE))
                    .add(Step2PanelLayout.createSequentialGroup()
                        .add(Step2RadioManual)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(Step2PanelLayout.createSequentialGroup()
                                .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel4)
                                    .add(jLabel3))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                    .add(Step2TextAlbum, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
                                    .add(Step2TextArtist)))
                            .add(Step2RadioDatabase))
                        .add(71, 71, 71))))
        );
        Step2PanelLayout.setVerticalGroup(
            Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(Step2PanelLayout.createSequentialGroup()
                .add(43, 43, 43)
                .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(Step2RadioManual)
                    .add(Step2RadioDatabase))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(Step2TextArtist, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(Step2PanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel4)
                    .add(Step2TextAlbum, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(120, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(159, Short.MAX_VALUE)
                .add(Step2Panel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 786, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(150, 150, 150))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(79, 79, 79)
                .add(Step2Panel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 279, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(102, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Checks if the Button is Selected.
     * <p/>
     * @return true if Manual is Selected
     */
    public Boolean isManuel(){
        return Step2RadioManual.isSelected();
    }

    /**
     * Getter for AlbumTextField.
     * <p/>
     * @return String with the Text
     */
    public String getAlbum(){
        return Step2TextAlbum.getText();
    }

    /**
     * Getter for ArtistTextField.
     * <p/>
     * @return String with the Text
     */
    public String getArtist(){
        return Step2TextArtist.getText();
    }

    private void extendedInit(){
        Step2RadioDatabase.setSelected(false);
        Step2RadioManual.setSelected(true);
        Step2TextAlbum.setEnabled(false);
        Step2TextArtist.setEnabled(false);
    }

    private void Step2RadioDatabaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Step2RadioDatabaseActionPerformed
        Step2RadioDatabase.setSelected(true);
        Step2RadioManual.setSelected(false);
        Step2TextAlbum.setEnabled(true);
        Step2TextArtist.setEnabled(true);
    }//GEN-LAST:event_Step2RadioDatabaseActionPerformed

    private void Step2RadioManualActionPerformed(java.awt.event.ActionEvent evt){//GEN-FIRST:event_Step2RadioManualActionPerformed
        Step2RadioManual.setSelected(true);
        Step2RadioDatabase.setSelected(false);
        Step2TextAlbum.setEnabled(false);
        Step2TextArtist.setEnabled(false);
    }//GEN-LAST:event_Step2RadioManualActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Step2Panel;
    private javax.swing.JRadioButton Step2RadioDatabase;
    private javax.swing.JRadioButton Step2RadioManual;
    private javax.swing.JTextField Step2TextAlbum;
    private javax.swing.JTextField Step2TextArtist;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    // End of variables declaration//GEN-END:variables
}
